<template>
	<view>
		<CustomCamera ref="CustomCamera" :coverImageType="coverImageType" @back="back" @getImage="getImage" />
	</view>
</template>

<script>
	// #ifdef APP
	import CustomCamera from "@/components/CustomCamera/APP/index.nvue"
	// #endif
	// #ifdef MP-WEIXIN
	import CustomCamera from "@/components/CustomCamera/WeChat/index.vue"
	// #endif
	export default {
		components: {
			CustomCamera
		},
		data() {
			return {
				coverImageType: 'side',
			}
		},
		onLoad(options) {
			this.txt = options.coverImageType == "side" ? "身份证反面" : (options.coverImageType == "front" ? "身份证正面" :
					"照片")
			// this.txt = options.coverImageType == "side" ? "身份证反面" : "身份证正面"
			this.token = uni.getStorageSync('token')
			this.coverImageType = options.coverImageType
			uni.setNavigationBarTitle({
				title: this.txt
			})
		},
		methods: {
			back() {
				uni.navigateBack()
			},
			getImage(res) {
				let params = {
					data: res,
					type: this.coverImageType,
					type_txt: this.txt
				}
				uni.$emit('getImage', params)
				uni.navigateBack()
			}
		}
	}
</script>

<style>

</style>